<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="iwpl.project.dao.AreasDAO"%>
<%@page import="iwpl.project.entities.Areas"%>
<%@page import="iwpl.project.dao.ApartmentsDAO"%>
<%@page import="iwpl.project.entities.Apartments"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script src="js/jquery-Source.js"></script>
<script type="text/javascript" src="js/jquery-Validation.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#commentForm").
validate();
  });
  </script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'Insert_Apartment.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" href="css/CommonCSS.css" type="text/css" />
	</head>

	<body>
		<form class="cmxform" id="commentForm" action="./servlet/Control_Apartment"  method="post">

			<style type="text/css">
label.error {
	float: none;
	color: red;
	padding-left: .5em;
	vertical-align: top;
}
</style>
			<tr align="center">
				<td>
					<br />
				</td>
			</tr>
			
				<div align="center" >
													<h1>
														Insert Apartment
													</h1>
					<table width="280" border="1" height="198">
						<tbody>
							<tr>
								<td>
									<table width="320" border="0" height="223">
										<tbody>
											
											
											<tr>
												<td>&nbsp;Area ID 
													 
												</td>
												<td> 
													&nbsp;<select name="cboAreaID" style="width:150px">
			<%
				ApartmentsDAO objDao= new ApartmentsDAO();
				List<Apartments> lstOff = objDao.findAll();
				for( Iterator it = lstOff.iterator(); it.hasNext(); ) {
							Apartments apart = (Apartments)it.next();
			 %> 				
			<option value="<%=apart.getAreas().getId()%>" label="<%=apart.getAreas().getId()%>"><%=apart.getAreas().getId() %>
			</option>
			<%} %>
			</select>

												</td>
											</tr>
											<tr>
												<td>
													&nbsp;Apartment Number
												</td>
												<td>&nbsp;<input type="text" name="txtApartmentNumber"
														class="required"> <br></td>
											</tr>
											<tr>
												<td>
													&nbsp;Floor Number
												</td>
												<td>&nbsp;<input type="text" name="txtFloorNumber" class="required">
												</td>
											</tr>
											<tr><td>
													&nbsp;Value
													
												</td>
												<td>&nbsp;<input type="text" name="txtValue" class="required" />
													
												</td>
												
											</tr>
											<tr>
												<td>
													&nbsp;Status
												</td>
												<td>
													<input type="checkbox" name="chkStatus">
												</td>
											</tr>
											<tr>
												<td valign="top">
													<br />
												</td>
												<td valign="top">&nbsp;&nbsp;
												</td>
											</tr>
											<tr>
												<td valign="" >	<input type="submit" value="Insert" name="btnInsert"></td>
												<td valign="top"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <input type="button" value="Back" name="btnBack" onclick="self.location='Manage_Apartment.jsp'">
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
							<tr>
							</tr>
						</tbody>
					</table>

				</div>
			</form>
	</body>
</html>
